// components/uploadWay/uploadWay.js
Component({

    /**
     * 组件的属性列表
     */
    properties: {
        showMultiBtn: false,
    },

    /**
     * 组件的初始数据
     */
    data: {
        confirmBtn: { content: '确定', variant: 'base' },
        showConfirm: false,
        showWarnConfirm: false,
        showTooLongBtnContent: false,
        
        multiBtnList: [
          { content: '文件上传', theme: 'primary' },
          { content: '手动输入', theme: 'primary' },
          { content: '仪器扫描', theme: 'primary' },
        ],
    },

    /**
     * 组件的方法列表
     */
    methods: {
        showDialog(e) {
            this.setData({ showMultiBtn: true});
          },
      
          closeDialog() {
            this.setData({ showMultiBtn: false });
          },
          handleButtonClick: function(event) {
            const index = event.detail.index;
            const buttonInfo = this.data.multiBtnList[index];
            this.setData({ showMultiBtn: false });
            switch(buttonInfo.content){
                case '文件上传':
                    wx.navigateTo({
                        url: '../../pages/bloodsugarfile/bloodsugarfile',
                    })
                    break;
                case '手动输入':
                    wx.navigateTo({
                        url: '../../pages/bloodsugarrecord/bloodsugarrecord',
                    })
                    break;
                case '仪器扫描':
                    break;
                default:
                    break;


            }

          },
    }
})